package workbench.VO;

import java.util.List;

public class VO<T> {
    private int total;
    private List<T> dataList;

    @Override
    public String toString() {
        return "VO{" +
                "total=" + total +
                ", dataList=" + dataList +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        VO<?> vo = (VO<?>) o;

        if (getTotal() != vo.getTotal()) return false;
        return getDataList() != null ? getDataList().equals(vo.getDataList()) : vo.getDataList() == null;
    }

    @Override
    public int hashCode() {
        int result = getTotal();
        result = 31 * result + (getDataList() != null ? getDataList().hashCode() : 0);
        return result;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public List<T> getDataList() {
        return dataList;
    }

    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }

    public VO(int total, List<T> dataList) {
        this.total = total;
        this.dataList = dataList;
    }

    public VO() {
    }
}
